﻿@{
    ViewBag.Title = "Infomation";
    Layout = "~/Views/Shared/_ViewFormPage.cshtml";
}
@model CompanyVM
@section head{

    <script type="text/javascript">
        $(function () {

            $("#btnSave").on("click", save);

        });


        function save() {
            if ($("form").valid()) {
                $('form').ajaxSubmit(
                {
                    beforeSubmit: function () {
                        $("#btnSave").off("click", save);
                    },
                    success: function (callback) {
                        if (callback) {
                            $("#btnSave").on("click", save);
                            $.ligerDialog.success('保存成功');
                        }
                        else {
                            $("#btnSave").on("click", save);
                            $.ligerDialog.error('保存失败');
                        }
                    },
                    error: function (ex) {
                        $("#btnSave").on("click", save);
                        $.ligerDialog.error('保存失败');
                    }
                });
            }
        }

    </script>

}
<div id="header" class="header">
    <h4>基本信息</h4>
</div>


@using (Html.BeginForm("Infomation", "Company", FormMethod.Post))
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => Model.CompanyID);
    <div id="detail_forms">

        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                企业名称
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.Name, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
                * 认真填写企业的全称
            </div>
        </div>
        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                联系人
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.ContactName, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
                * 联系人 
            </div>
        </div>
        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                联系电话
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.Phone, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
                * 手机或固话 {例：025-66666666}
            </div>
        </div>
        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                传真号码
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.Fax, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
                &nbsp; 
            </div>
        </div>

        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                电子邮箱
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.Email, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
                * 企业电子邮件，方便客户联系
            </div>
        </div>


        <div class="formsItems clearfix" style="display:none;">
            <div class="formItem labelItem">
                备案号码
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.PublishNumber, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
            </div>
        </div>

        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                企业地址
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.Address, new { @class = "texts", style = "width:300px;" })
            </div>
            <div class="formItem msgItem">
                * 公司的详细地址
            </div>
        </div>

        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                企业简介
            </div>
            <div class="formItem textItem">
                @Html.TextAreaFor(model => model.Intro, new { @class = ".ifunny-textareas", style = "width:400px;height:60px;" })
            </div>
            <div class="formItem msgItem">
            </div>
        </div>


        <div id="btnContainer" class="formsItems">
            <div class="formItem labelItem">
                &nbsp;
            </div>
            <div class="formItem textItem">
                <a href="javascript:void(0);" id="btnSave">保存</a>
            </div>
            <div class="formItem">
            </div>
        </div>
    </div>
}
